load(
    "//tools:defaults.bzl",
    "ng_module",
    "ng_test_library",
    "ng_web_test_suite",
    "sass_binary",
    "sass_library",
)

package(default_visibility = ["//visibility:public"])

ng_module(
    name = "mdc-tooltip",
    srcs = glob(
        ["**/*.ts"],
        exclude = [
            "**/*.spec.ts",
        ],
    ),
    assets = [
        ":tooltip_scss",
    ] + glob(["**/*.html"]),
    module_name = "@angular/material-experimental/mdc-tooltip",
    deps = [
        "//src/material-experimental/mdc-core",
        "//src/material/tooltip",
        "@npm//@material/tooltip",
    ],
)

sass_library(
    name = "mdc_tooltip_scss_lib",
    srcs = glob(["**/_*.scss"]),
    deps = [
        "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
        "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
    ],
)

sass_binary(
    name = "tooltip_scss",
    src = "tooltip.scss",
    include_paths = [
        "external/npm/node_modules",
    ],
    deps = [
        "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
        "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
    ],
)

ng_test_library(
    name = "tooltip_tests_lib",
    srcs = glob(
        ["**/*.spec.ts"],
        exclude = [
            "**/*.e2e.spec.ts",
        ],
    ),
    deps = [
        ":mdc-tooltip",
        "//src/cdk/a11y",
        "//src/cdk/bidi",
        "//src/cdk/keycodes",
        "//src/cdk/overlay",
        "//src/cdk/platform",
        "//src/cdk/testing/private",
        "@npm//@angular/animations",
        "@npm//@angular/platform-browser",
    ],
)

ng_web_test_suite(
    name = "unit_tests",
    static_files = ["@npm//:node_modules/@material/tooltip/dist/mdc.tooltip.js"],
    deps = [
        ":tooltip_tests_lib",
        "//src/material-experimental:mdc_require_config.js",
    ],
)
